#include "testwindow.h"
#include "browseview.h"
#include <QImageWriter>
#include "effecttoolkit.h"
#include "camerawidget.h"
#include <QApplication>
#include "myqevent.h"
#include <QMouseEvent>
#include <QDebug>
#include <QFileDialog>
#include "QProgressIndicator.h"

testWindow::testWindow(QWidget *parent) :
    QMainWindow(parent),
    m_pi(NULL)
{
    m_camerawidget = new CameraWidget(this);
    m_camerawidget->setGeometry(183,135,245,170);
    m_camerawidget->showMaximized();
//    connect(this,SIGNAL(cameraclick()),m_camerawidget,SLOT(capture()));
    QApplication::sendEvent(m_camerawidget, new QMyEvent);

    if(m_pi == NULL)
    {
        m_pi = new QProgressIndicator(this);
        m_pi->setWindowModality(Qt::WindowModal);
        m_pi->raise();
        m_pi->setGeometry(320,180,100,100);
        m_pi->startAnimation();
        m_pi->show();

        setEnabled(false);
    }
//    update();
}

void testWindow::paintEvent(QPaintEvent *event)
{

}

void testWindow::mousePressEvent(QMouseEvent *event)
{
//    qWarning()<<m_FilePath;

}
